<?php get_header(); ?>
<div id="container" class="cf">
<div id="main">
<?php query_posts('showposts=1&cat=1'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php $youtubeUrl = post_custom('youtube'); ?>
<?php if (!empty($youtubeUrl)) { ?>
<div id="main_movie" class="singlep">
<object width="640" height="360">
  <param name="movie" value="https://www.youtube.com/v/<?= $youtubeUrl ?>?cc_load_policy=1&hl=ja&cc_lang_pref=ja&modestbranding=1&rel=0&showinfo=1&color=white&iv_load_policy=3&version=3"></param>
  <param name="allowFullScreen" value="true"></param>
  <param name="allowScriptAccess" value="always"></param>
  <embed src="https://www.youtube.com/v/<?= $youtubeUrl ?>?cc_load_policy=1&hl=ja&cc_lang_pref=ja&modestbranding=1&rel=0&showinfo=0&color=white&iv_load_policy=3&version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="360"></embed>
</object>
</div>
<?php } ?>
<div class="bnr_top"><a href="<?php echo home_url(); ?>/?page_id=78"><img src="<?php echo home_url(); ?>/images/8bit_sky3_90-640.jpg" alt="ニュースを創るのはあなただ！" /></a></div>
<?php endwhile; endif; ?>

<h2 class="h_8bit"><a href="<?php echo home_url(); ?>/?cat=19">8bitNewsの動画</a></h2>
<div class="box_type1">
<ul id="list_movie" class="cf">
<?php query_posts('showposts=8&cat=19'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php $youtubeUrl = post_custom('youtube'); ?>
<li>
<a href="<?php the_permalink(); ?>"><img src="http://img.youtube.com/vi/<?= $youtubeUrl ?>/default.jpg" alt="<?php echo substr(strip_tags(the_title()), 0, 28);  ?>" class="our" /></a>
<span><?php the_time('m.d.Y'); ?></span>
<p>
<a href="<?php the_permalink(); ?>" class="listgreen"><?php
if(mb_strlen($post->post_title,'UTF-8')>30) {
$title= mb_substr($post->post_title,0,30,'UTF-8');
echo $title.…;} else {
echo $post->post_title;}
?></a>
</p>
</li>
<?php endwhile; endif; ?>
</ul>
<div class="top_morea"><a href="<?php echo home_url(); ?>/?cat=19">もっと見る &raquo;</a></div>
</div>

<h2 class="h_8bit"><a href="<?php echo home_url(); ?>/?cat=556">Pay Forward</a></h2>
<div class="box_type1">
<ul id="list_movie" class="cf">
<?php query_posts('showposts=4&cat=556'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php $youtubeUrl = post_custom('youtube'); ?>
<li>
<a href="<?php the_permalink(); ?>"><img src="http://img.youtube.com/vi/<?= $youtubeUrl ?>/default.jpg" alt="<?php echo substr(strip_tags(the_title()), 0, 28);  ?>" class="our" /></a>
<span><?php the_time('m.d.Y'); ?></span>
<p>
<a href="<?php the_permalink(); ?>" class="listgreen"><?php
if(mb_strlen($post->post_title,'UTF-8')>40) {
$title= mb_substr($post->post_title,0,40,'UTF-8');
echo $title.…;} else {
echo $post->post_title;}
?></a>
</p>
</li>
<?php endwhile; endif; ?>
</ul>
<div class="top_morea"><a href="<?php echo home_url(); ?>/?cat=556">もっと見る &raquo;</a></div>
</div>

<h2 class="h_ev"><a href="<?php echo home_url(); ?>/?cat=4">みんなの投稿動画</a></h2>
<div class="box_type1">
<ul id="list_movie" class="cf">
<?php query_posts('showposts=12&cat=4'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php $youtubeUrl = post_custom('youtube'); ?>
<li>
<a href="<?php the_permalink(); ?>"><img src="http://img.youtube.com/vi/<?= $youtubeUrl ?>/default.jpg" alt="<?php echo substr(strip_tags(the_title()), 0, 28);  ?>" class="ev" /></a>
<span><?php the_time('m.d.Y'); ?></span>
<p>
<a href="<?php the_permalink(); ?>" class="listpink"><?php
if(mb_strlen($post->post_title,'UTF-8')>30) {
$title= mb_substr($post->post_title,0,30,'UTF-8');
echo $title.…;} else {
echo $post->post_title;}
?></a>
</p>
</li>
<?php endwhile; endif; ?>
</ul>
<div class="top_moreb"><a href="<?php echo home_url(); ?>/?cat=4">もっと見る &raquo;</a></div>
</div>


<div class="cf">
<div class="column2 left">
<h2><a href="<?php echo home_url(); ?>/?cat=16">新着情報</a></h2>
<div class="box_type3">
<dl>
<?php query_posts('showposts=3&cat=16'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<dt><?php the_time('Y/m/d'); ?></dt>
<dd><a href="<?php the_permalink(); ?>"><?php echo substr(strip_tags(the_title()), 0, 30);  ?></a></dd>
<?php endwhile; endif; ?>
</dl>
</div>
</div>
<div class="column2 right">
<h2><a href="<?php echo home_url(); ?>/?cat=17">アクセスロード</a></h2>
<div class="box_type3">
<dl>
<?php query_posts('showposts=4&cat=17'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<dt><?php the_time('Y/m/d');  ?></dt>
<dd><a href="<?php the_permalink(); ?>"><?php echo substr(strip_tags(the_title()), 0, 30);  ?></a></dd>
<?php endwhile; endif; ?>
</dl>
</div>
</div>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>